package com.ybwh.springboot2.common;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

/**
 * <p>
 * 登录令牌信息
 * </p>
 *
 * @author fanbeibei
 * @version V1.0
 * @since 2019/5/16 21:37
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
public class TokenInfo {
    public static final long DEFAULT_EXPIRE = 2 * 60 * 60 * 1000;

    /**
     * 用户名
     */
    private String username;

    /**
     * 时间戳（格林威治时间,ms）
     */
    private Long time;
    
    /**
     * 过期时间(ms)
     */
    private Long expire;

    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this, ToStringStyle.JSON_STYLE);
    }

}
